package com.ddm.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ddm.mapper.CustomerMapper;
import com.ddm.service.ICustomerService;
import com.entity.Customer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by he on 2025/3/24 20:57
 */
@Service
public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> implements ICustomerService {
    // 自动注入CustomerMapper
    @Autowired
    private CustomerMapper customerMapper;
    // 根据消费者ID查询消费者信息
    @Override
    public Customer selectCustomerById(Integer customerId) {
        return customerMapper.selectCustomerById(customerId);
    }

    // 根据客户ID删除客户信息
    @Override
    public int deleteCustomerById(Integer customerId) {
        return customerMapper.deleteCustomerById(customerId);
    }

    // 根据客户信息查询客户列表
    @Override
    public List<Customer> selectCustomerList(Customer customer) {
        return customerMapper.selectCustomerList(customer);
    }
}
